package com.nvwa.coding.function;

import com.nvwa.coding.util.safe.Coding;

import java.util.function.Supplier;


@FunctionalInterface
public interface SupplierEX<T, EX extends Throwable> {

    T get() throws EX;

    default Supplier<T> toSilentSupplier(T orElse) {
        return () -> Coding.silentGetOrElse(this, orElse);
    }

    default Supplier<T> toLoggingSupplier(T orElse) {
        return () -> Coding.loggingGetOrElse(this, orElse);
    }

}
